Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bind mount X11 socket instead of symlinking #420

Merged
merged 1 commit into from
Feb 24, 2024
Merged

Conversation

nzbr
Copy link
Member

@nzbr nzbr commented Feb 12, 2024

Fixes #328
Bind mount the X0 socket instead of symlinking /tmp/.X11-unix to make FHS environments work

@github-actions github-actions bot added the bug Something isn't working label Feb 12, 2024
@K900
Copy link
Contributor

K900 commented Feb 18, 2024

Didn't we specifically switch from a bind mount to a symlink at some point? I don't remember now :(

@SuperSandro2000
Copy link
Member

It was initially added here #115 because tmpfiles was deleting the file.

We removed the tmpfiles creation in #172 because microsoft changed it and it didn't merge properly.

It was added back in #207.

I think it was from the beginning a tmpfiles rule, because that is what microsoft was using at the time and it merged properly for a bit.

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Feb 24, 2024

After a switch I got this (expected) error:

warning: the following units failed: tmp-.X11\x2dunix-X0.mount

× tmp-.X11\x2dunix-X0.mount - /tmp/.X11-unix/X0
     Loaded: loaded (/etc/fstab; generated)
     Active: failed (Result: resources)
      Where: /tmp/.X11-unix/X0
       What: /mnt/wslg/.X11-unix/X0
       Docs: man:fstab(5)
             man:systemd-fstab-generator(8)

Feb 24 16:24:20 carbon systemd[1]: tmp-.X11\x2dunix-X0.mount: Mount path /tmp/.X11-unix/X0 is not canonical (contains a symlink).
Feb 24 16:24:20 carbon systemd[1]: tmp-.X11\x2dunix-X0.mount: Failed with result 'resources'.
Feb 24 16:24:20 carbon systemd[1]: Failed to mount /tmp/.X11-unix/X0.
warning: error(s) occurred while switching to the new configuration

after a restart this went away and tmpfiles (sudo systemd-tmpfiles --clean; sudo systemd-tmpfiles --create) works as expected and now fhs envs (eg esphome through platformio) works.

Going to merge this and lets revisit it, if we overlooked something.

@SuperSandro2000 SuperSandro2000 merged commit 7e3fc6a into main Feb 24, 2024
25 checks passed
@SuperSandro2000 SuperSandro2000 deleted the x11-socket branch February 24, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't enter FHS environment with /tmp/.X11-unix soft linked to /mnt/wslg/.X11-unix
3 participants